#ifndef _TOOL_H_
#define _TOOL_H_

#include "cocos2d.h"

USING_NS_CC;

typedef enum tagToolState
{
    kToolStateGrabbed,
    kToolStateUngrabbed
} ToolState;

class Tool : public CCSprite, public CCTargetedTouchDelegate
{
    ToolState t_state;
    
public:
    Tool(void);
	~Tool(void);
    
    CCRect rect();
    CCAnimation ccAnimation;
    CCAnimate ccAnimate;
    float positionX;
    float positionY;
    
    int rectWidth;
    int rectHeight;
    
    int px;
    int py;
    
    std::string imageName;
    
    int animateCount;
    std::string animateString;

    virtual void createAnimate(CCAnimation* animation);
    
    bool initWithTexture(CCTexture2D* aTexture);
    bool containsTouchLocation(CCTouch* touch);
    
    virtual void onEnter();
    virtual void onExit();
    
    virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
    virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
    virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
    
    virtual void touchDelegateRetain();
    virtual void touchDelegateRelease();
    
    int moveType;
};
#endif

